3.117 \(\int \frac {\sec ^4(c+d x)}{(a+i a \tan (c+d x))^2} \, dx\)

Optimal. Leaf size=38 \[ -\frac {\tan (c+d x)}{a^2 d}+\frac {2 i \log (\cos (c+d x))}{a^2 d}+\frac {2 x}{a^2} \]

[Out]

2*x/a^2+2*I*ln(cos(d*x+c))/a^2/d-tan(d*x+c)/a^2/d

________________________________________________________________________________________

Rubi [A]  time = 0.05, antiderivative size = 38, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 24, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.083, Rules used = {3487, 43} \[ -\frac {\tan (c+d x)}{a^2 d}+\frac {2 i \log (\cos (c+d x))}{a^2 d}+\frac {2 x}{a^2} \]

Antiderivative was successfully verified.

[In]

Int[Sec[c + d*x]^4/(a + I*a*Tan[c + d*x])^2,x]

[Out]

(2*x)/a^2 + ((2*I)*Log[Cos[c + d*x]])/(a^2*d) - Tan[c + d*x]/(a^2*d)

Rule 43

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rule 3487

Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Dist[1/(a^(m - 2)*b
*f), Subst[Int[(a - x)^(m/2 - 1)*(a + x)^(n + m/2 - 1), x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, e, f, n}, x
] && EqQ[a^2 + b^2, 0] && IntegerQ[m/2]

Rubi steps

\begin {align*} \int \frac {\sec ^4(c+d x)}{(a+i a \tan (c+d x))^2} \, dx &=-\frac {i \operatorname {Subst}\left (\int \frac {a-x}{a+x} \, dx,x,i a \tan (c+d x)\right )}{a^3 d}\\ &=-\frac {i \operatorname {Subst}\left (\int \left (-1+\frac {2 a}{a+x}\right ) \, dx,x,i a \tan (c+d x)\right )}{a^3 d}\\ &=\frac {2 x}{a^2}+\frac {2 i \log (\cos (c+d x))}{a^2 d}-\frac {\tan (c+d x)}{a^2 d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.44, size = 71, normalized size = 1.87 \[ \frac {4 \tan ^{-1}(\tan (d x))+i \sec (c) \sec (c+d x) \left (\cos (d x) \log \left (\cos ^2(c+d x)\right )+\cos (2 c+d x) \log \left (\cos ^2(c+d x)\right )+2 i \sin (d x)\right )}{2 a^2 d} \]

Antiderivative was successfully verified.

[In]

Integrate[Sec[c + d*x]^4/(a + I*a*Tan[c + d*x])^2,x]

[Out]

(4*ArcTan[Tan[d*x]] + I*Sec[c]*Sec[c + d*x]*(Cos[d*x]*Log[Cos[c + d*x]^2] + Cos[2*c + d*x]*Log[Cos[c + d*x]^2]
 + (2*I)*Sin[d*x]))/(2*a^2*d)

________________________________________________________________________________________

fricas [A]  time = 0.50, size = 68, normalized size = 1.79 \[ \frac {4 \, d x e^{\left (2 i \, d x + 2 i \, c\right )} + 4 \, d x + {\left (2 i \, e^{\left (2 i \, d x + 2 i \, c\right )} + 2 i\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) - 2 i}{a^{2} d e^{\left (2 i \, d x + 2 i \, c\right )} + a^{2} d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)^4/(a+I*a*tan(d*x+c))^2,x, algorithm="fricas")

[Out]

(4*d*x*e^(2*I*d*x + 2*I*c) + 4*d*x + (2*I*e^(2*I*d*x + 2*I*c) + 2*I)*log(e^(2*I*d*x + 2*I*c) + 1) - 2*I)/(a^2*
d*e^(2*I*d*x + 2*I*c) + a^2*d)

________________________________________________________________________________________

giac [B]  time = 0.98, size = 100, normalized size = 2.63 \[ \frac {2 \, {\left (\frac {i \, \log \left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1\right )}{a^{2}} - \frac {2 i \, \log \left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - i\right )}{a^{2}} + \frac {i \, \log \left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1\right )}{a^{2}} + \frac {-i \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + i}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )} a^{2}}\right )}}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)^4/(a+I*a*tan(d*x+c))^2,x, algorithm="giac")

[Out]

2*(I*log(tan(1/2*d*x + 1/2*c) + 1)/a^2 - 2*I*log(tan(1/2*d*x + 1/2*c) - I)/a^2 + I*log(tan(1/2*d*x + 1/2*c) -
1)/a^2 + (-I*tan(1/2*d*x + 1/2*c)^2 + tan(1/2*d*x + 1/2*c) + I)/((tan(1/2*d*x + 1/2*c)^2 - 1)*a^2))/d

________________________________________________________________________________________

maple [A]  time = 0.36, size = 35, normalized size = 0.92 \[ -\frac {2 i \ln \left (\tan \left (d x +c \right )-i\right )}{a^{2} d}-\frac {\tan \left (d x +c \right )}{a^{2} d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sec(d*x+c)^4/(a+I*a*tan(d*x+c))^2,x)

[Out]

-2*I/a^2/d*ln(tan(d*x+c)-I)-tan(d*x+c)/a^2/d

________________________________________________________________________________________

maxima [A]  time = 0.32, size = 32, normalized size = 0.84 \[ \frac {-\frac {2 i \, \log \left (i \, \tan \left (d x + c\right ) + 1\right )}{a^{2}} - \frac {\tan \left (d x + c\right )}{a^{2}}}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)^4/(a+I*a*tan(d*x+c))^2,x, algorithm="maxima")

[Out]

(-2*I*log(I*tan(d*x + c) + 1)/a^2 - tan(d*x + c)/a^2)/d

________________________________________________________________________________________

mupad [B]  time = 3.35, size = 28, normalized size = 0.74 \[ -\frac {\mathrm {tan}\left (c+d\,x\right )+\ln \left (\mathrm {tan}\left (c+d\,x\right )-\mathrm {i}\right )\,2{}\mathrm {i}}{a^2\,d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(cos(c + d*x)^4*(a + a*tan(c + d*x)*1i)^2),x)

[Out]

-(log(tan(c + d*x) - 1i)*2i + tan(c + d*x))/(a^2*d)

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ - \frac {\int \frac {\sec ^{4}{\left (c + d x \right )}}{\tan ^{2}{\left (c + d x \right )} - 2 i \tan {\left (c + d x \right )} - 1}\, dx}{a^{2}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)**4/(a+I*a*tan(d*x+c))**2,x)

[Out]

-Integral(sec(c + d*x)**4/(tan(c + d*x)**2 - 2*I*tan(c + d*x) - 1), x)/a**2

________________________________________________________________________________________